package com.javaframe.role.aop.aspect;

import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;


@Aspect
@Component
public class LogAdvice {
	@Pointcut("execution(* com.javaframe.role.service.*.*(..))")
//	@Pointcut("execution(* com.javaframe.role.service.UserService.find(..))")
	public void inServiceLayer() {}
	@Before(value="inServiceLayer()")
	//@Before("execution(* com.javaframe.role.service.*.*(..))")
	//@Before("com.javaframe.role.aop.aspect.PointCut.inServiceLayer()")
	public void logInfo() {
        System.out.println("=====================================");
         System.out.println("Aop: do before in service layer");
        System.out.println("=====================================");
    }
//	@AfterReturning("inServiceLayer() && args(name,..)")
	//@AfterReturning("execution(* com.javaframe.role.service.*.*(..) )&& args(name,..)")
//	public void logInfoAfter(String name){
//		System.out.println("【守护者】抓住了猴子,守护者审问出了猴子的名字叫“"+name+"”...");
//	}
}
